package com.huajx.hanvon.handler;

import com.huajx.core.kit.AsyncHttpClientKit;
import com.huajx.core.message.RequestMessage;
import com.huajx.core.message.ResponseMessage;
import com.huajx.hanvon.Const;
import com.huajx.hanvon.HanvonTcpServer;

import org.apache.mina.core.session.IoSession;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Map;

public class RecordHandler extends AbstractHanvonHandler {
    private final static Logger logger = LoggerFactory.getLogger(RecordHandler.class);

    @Override
    public ResponseMessage handler(RequestMessage request) {
        Map<String, Object> paras = getPara(request.getSession());
        paras.put("content", request.getMessage());
        // 处理卡点数据
        AsyncHttpClientKit.post(HanvonTcpServer.config.getServerUrl() + Const.post_record, paras, content -> {
            logger.info("处理卡点数据{}",content);
        });

        return null;
    }
}
